<%--
  Created by IntelliJ IDEA.
  User: HUAWEI
  Date: 2023/12/31
  Time: 20:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员登录</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>

    <style>
        body {
            background: url("${pageContext.request.contextPath}/images/adminLogin.jpg");
            background-size: cover;
        }
    </style>
</head>
<body>

<div class="container" style="margin-top: 110px">
    <div class="row">
        <div class="col"></div>
        <div class="col-5">
            <div class="shadow p-3 mb-5 bg-white rounded" style="background-color: rgba(255,255, 255, 0.5);">
                <%--            <div class="shadow-none p-3 mb-5 bg-light rounded">--%>
                <%--                <div class="container">管 理 员 登 录</div>--%>
                <h3 style="color: red;text-align: center">管 理 员 登 录</h3>
                <form method="post" action="adminLogin">
                    <div class="form-group">
                        <p>
                            <label for="User" style="float: left">用户名</label><label
                                style="color:red;float: left">*</label>
                            <input type="text" class="form-control" id="User" name="admin"
                                   value="${not empty admin_login_req ? admin_login_req : ""}">
                        </p>
                        <p>
                            <label for="password" style="float: left">密 &nbsp;&nbsp;码</label><label
                                style="color:red;float: left">*</label>
                            <input type="text" class="form-control" id="password" name="pwd"
                                   value="${not empty admin_login_req_pwd ? admin_login_req_pwd : ""}">
                        </p>
                        <p>
                        <div style="float: left">
                            <label for="code" style="float: left">验证码</label><label
                                style="color:red;float: left">*</label><br/>
                            <input type="text" class="form-control" id="code" style="width: 340px"
                                   name="code" value="${not empty admin_login_req_code?admin_login_req_code:""}">
                        </div>
                        <div style="float: left;margin-top: 35px">
                            <label id="label_code"><img src="${pageContext.request.contextPath}/code"
                                                        id="sr" alt="加载中..."></label>
                        </div>
                        </p>
                        <p>
                        <div class="custom-control custom-checkbox custom-control-inline"
                             style="float: left">
                            <input type="checkbox" class="custom-control-input" id="idname" name="remember"
                                   value="1">
                            <label for="idname" class="custom-control-label">记住密码</label>
                        </div>
                        </p>


                    </div>
                    <div style="margin-top: 140px">
                        <p>
                            <input type="submit" class="btn btn-danger btn-lg btn-block" value="登 录">
                        </p>
                        <div style="text-align: center">
                            <span style="color: red;margin-top: 18px">${admin_login_from_info}</span>
                            <span style="color: red;margin-top: 18px">${admin_login_info}</span>
                            <span style="color: red;">${admin_login_code_info}</span>
                        </div>

                    </div>

                    <%--                    <div style="float: left">
                                            <label for="code" style="float: left">验证码</label><label
                                                style="color:red;float: left">*</label><br/>
                                            <input type="text" class="form-control" id="code" style="width: 250px"
                                                   name="code" value="${not empty login_req_code?login_req_code:""}"><br/>
                                        </div>
                                        <div style="float: right;margin-top: 35px">
                                            <label id="label_code"><img src="${pageContext.request.contextPath}/code"
                                                                        id="sr" alt="加载中..."></label>
                                        </div>

                                        <div class="custom-control custom-checkbox custom-control-inline"
                                             style="float: left">
                                            <input type="checkbox" class="custom-control-input" id="idname" name="remember"
                                                   value="1">
                                            <label for="idname" class="custom-control-label">记住密码</label>
                                        </div>
                                    </div>
                                    <div style="margin-top: 150px">
                                        <span style="color: red;margin-top: 18px">${login_from_info}</span>
                                        <span style="color: red;margin-top: 18px">${login_user_info}</span>
                                        <span style="color: red;">${login_code_info}</span>
                                        <input type="submit" class="btn btn-danger btn-lg btn-block" value="登 录"><br/>
                                    </div>
                                    <div>
                                        还没有新闻网账号？
                                        <a href="register.jsp">立即注册</a>
                                    </div>--%>
                </form>
            </div>
        </div>
        <div class="col"></div>
    </div>
</div>
</body>
</html>

<script>
    document.getElementById("label_code").onclick = function () {
        let img = document.getElementById("sr");
        img.src = "${pageContext.request.contextPath}/code?a=" + Math.random();
    }
</script>
